package br.edu.delta.model;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * <p>
 * <b>Title:</b> Leitor
 * </p>
 * 
 * <p>
 * <b>Description:</b> Leitor
 * </p>
 * 
 * <p>
 * <b>Company: </b>
 * </p>
 * 
 * @author Denis
 * 
 * @version 1.0.0
 */
@Entity
@Table(name = "tbl_leitores")
@SequenceGenerator(name = EntidadeImpl.SEQUENCE_GENERATOR, sequenceName = "seq_tbl_leitores", allocationSize = 1, initialValue = 1)
public class Leitor extends Pessoa {

	/** Atributo serialVersionUID. */
	private static final long serialVersionUID = 5886040720398125676L;

	/** Atributo endereco. */
	@ManyToOne(fetch = FetchType.EAGER, cascade = { CascadeType.REFRESH }, optional = false, targetEntity = Endereco.class)
	@JoinColumn(insertable = true, unique = false, name = "id_endereco", updatable = true, nullable = false)
	private Endereco endereco;

	/**
	 * Retorna o valor do atributo <code>endereco</code>
	 * 
	 * @return <code>Endereco</code>
	 */
	public Endereco getEndereco() {

		return endereco;
	}

	/**
	 * Define o valor do atributo <code>endereco</code>.
	 * 
	 * @param endereco
	 */
	public void setEndereco(Endereco endereco) {

		this.endereco = endereco;
	}

}
